#ifndef _MESSAGE_H_
#define _MESSAGE_H_
#include"public.h"
#include"timeStamp.h"

#include<iostream>
#include<sstream>


class Message{
private:
 std::string coloredHeader_;//有颜色的头部
 std::string commonHeader_;//无颜色的头部
 std::string msg_;//消息

 std::string formatFeildWithColor(COLOR_NUMBER ,bool ,const std::string ,const std::string &,bool colored = true);
public:
 Message()=delete;
 Message(LOG_LEVEL ,const std::string& ,const std::string &,int, bool colored = true);
 std::string FormatHeader(LOG_LEVEL , std::string ,const std::string& ,int , bool colored = true );
 std::string ToString(bool colored = true)const;

template<class T>
 Message&  operator<<(const T &t)
 {
    std::stringstream ss;
    ss<<t;
    msg_ += ss.str();
    return *this;
 }
};
#endif